#ifndef __FAST_RPC_SERVER_RPC_H__
#define __FAST_RPC_SERVER_RPC_H__

#include <string>

#include "ret.h"
#include "config.h"
#include "fifo.h"

namespace fast_rpc
{

class RPCServer
{

public:
    ~RPCServer();

    static RPCServer& Create(const std::string& name);

    Ret Init(const Config& config);
    Ret Start(bool& flag);

    Ret Destroy();

private:
    // 单例
    RPCServer(const std::string& name): m_name(name) {}

    std::string m_name;
    Config m_config;
    FIFO<Requst, FIFO_ROLE_CREATOR>::PTR m_reader;
    FIFO<Response, FIFO_ROLE_CREATOR>::PTR m_writer;

}; // class RPCServer

} // namespace fast_rpc

#endif  // __FAST_RPC_SERVER_RPC_H__